package com.bbs.action;

import java.util.List;

import com.bbs.bean.BbsBlock;
import com.bbs.services.BbsBlockManager;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.ModelDriven;
import com.opensymphony.xwork2.Preparable;

public class BbsBlockAction extends ActionSupport implements Preparable,ModelDriven {
	
	private static final String  LIST="/bbsBlock/bbsBlockList.jsp";
	private static final String  EDIT="/bbsBlock/bbsBlockEdit.jsp";
	private static final String  ADD="/bbsBlock/bbsBlockAdd.jsp";
	private static final String  SHOW="/bbsBlock/bbsBlockShow.jsp";
	private static final String  MIANLIST="/index.jsp";
	
	private BbsBlock bbsBlock;
	private BbsBlockManager bbsBlockManager;
	private int id;
	private List<BbsBlock> bbsBlockList;
	private int page;
	private int maxpage;
	
	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getMaxpage() {
		return maxpage;
	}

	public void setMaxpage(int maxpage) {
		this.maxpage = maxpage;
	}

	public void prepare() throws Exception {
		// TODO Auto-generated method stub
		
	}

	public Object getModel() {
		// TODO Auto-generated method stub
		return bbsBlock;
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public List<BbsBlock> getBbsBlockList() {
		return bbsBlockList;
	}

	public void setBbsBlockList(List<BbsBlock> bbsBlockList) {
		this.bbsBlockList = bbsBlockList;
	}

	public void setBbsBlockManager(BbsBlockManager bbsBlockManager) {
		this.bbsBlockManager = bbsBlockManager;
	}
	
	public String mainList(){
		bbsBlockList=bbsBlockManager.findAll();
		return MIANLIST;
	}
	
	
}
